#######################################################################
#                             Eigen types                             #
#######################################################################

snippet Ev "Eigen::Vector" i
Eigen::Vector${1:Xf}$0
endsnippet

snippet Em "Eigen::Matrix" i
Eigen::Matrix${1:Xf}$0
endsnippet

snippet "Ev(z|[o1]|r)" "Eigen::Vector::Zero/Ones/Random" r
Eigen::Vector${1:Xf}::`!p
m = {'z': 'Zero', 'o': 'Ones', '1': 'Ones', 'r': 'Random'}
snip.rv += m[match.group(1)]
` (${2:N})$0
endsnippet

snippet "Em(i|z|[o1]|r)" "Eigen::Matrix::Identity/Zero/Ones/Random" r
Eigen::Matrix${1:Xf}::`!p
m = {'i': 'Identity', 'z': 'Zero', 'o': 'Ones', '1': 'Ones', 'r': 'Random'}
snip.rv += m[match.group(1)]
` (${2:N}, ${3:M})$0
endsnippet

snippet .tp "Transpose" i
.transpose ()$0
endsnippet

snippet ".di(ag)?" "Diagonal" ir
.diagonal ()$0
endsnippet

snippet .* "Element-wise product" i
.cwiseProduct (${1:Q})$0
endsnippet

snippet Enew "Eigen make aligned operator new" b
public:
	EIGEN_MAKE_ALIGNED_OPERATOR_NEW
endsnippet
